#include <stdio.h>

int main()
{
 int n, i, sum;
 
 printf("Enter a positive number: ");
 scanf("%d", &n);
 
 sum = 0;
 i = 1;
 while (i <= n)    
 { 
   sum += i;
   i++;       
 }   
  
 printf ("sum = %d", sum);
 printf ("i = %d", i);
}
